Repository navigation
fix: escape non-BMP noncharacters as surrogate pairs in escapeUnicode - #2726
1AbdullahButt wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
✅ Deploy Preview for creative-fairy-df92c4 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Please summarize the PR description! |
|
Shortened the description, thanks. |
escapeUnicodeescapeUnicode
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/is-background
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2726 +/- ##
==========================================
- Coverage 80.35% 80.26% -0.10%
==========================================
Files 140 140
Lines 4175 4176 +1
Branches 968 968
==========================================
- Hits 3355 3352 -3
- Misses 720 725 +5
+ Partials 100 99 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aklinker1
left a comment
There was a problem hiding this comment.
Thanks for the PR, two small changes.
|
Looks like checks are also failing: You can disable the rule for that file. |
|
Thanks, switched the tests to |
|
@1AbdullahButt Formatting check( |
…icode `experimental.escapeUnicode` wrote code points above U+FFFF as a single `\u` escape with 5-6 hex digits (e.g. `\u1ffff`), which JavaScript reads as U+1FFF followed by a literal digit. Escape each UTF-16 code unit instead so these characters become valid surrogate-pair escapes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
854ec23 to
057b524
Compare
@1AbdullahButt You sure? Extra quotes and new Function are still there |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
You're right, sorry about that. When I rebased onto main on the 26th, I used a local branch that didn't have those changes, so the force-push dropped them. They're back in d6a2db6 now: the first two tests have no extra quotes, and the round-trip test uses
|
Overview
escapeUnicodewas writing noncharacters above U+FFFF as 5-6 digit escapes like\u1ffff. JavaScript only reads 4 hex digits after\u, so that gets parsed as a different character followed by a strayf.Now those characters are written as a surrogate pair of two 4-digit escapes (e.g.
\ud83f\udfff), which is the correct way to write them in JS. Output for normal BMP characters is unchanged.I also added a test file with 4 tests. 2 of them fail without the fix, and all 4 pass with it. After review, the tests use
JSON.parseinstead ofnew Function, and I removed the extra quotes. A maintainer also added a commit that disables theno-control-regexlint rule for the test file.Manual Testing
Ran the new tests with
bunx vitest. All 4 pass with the fix, and 2 of 4 fail without it. The formatting check passes too.Related Issue
Closes #2725
I used Claude Code to help write the code. I reviewed it.